#include <Square.h>
#include <cmath>

using namespace std;

static double
getRoundPrecision(double input, int precision)
{
    return round(input * pow(10, precision)) / pow(10, precision);
}

Square::Square(double width) :
     rectangle_m(width,width)
{

}

double
Square::getArea() const
{
    return rectangle_m.getArea();
}

double
Square::getPerimeter() const
{
    return rectangle_m.getPerimeter();
}

bool
Square::isValid() const
{
    return rectangle_m.isValid();
}

bool
Square::changeWidth(double width)
{
    return rectangle_m.changeLength(width)&&rectangle_m.changeWidth(width);
}

